home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / checkDocument.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-01-25  |  4.6 KB  |  166 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. #ifndef CHECKDOCUMENT_H
  8. #define CHECKDOCUMENT_H
  9.  
  10. #include <QMap>
  11.  
  12. class QEvent;
  13. class QHBoxLayout;
  14. class QLabel;
  15. class QPushButton;
  16. class QTreeWidget;
  17. class QTreeWidgetItem;
  18. class QVBoxLayout;
  19.  
  20. #include "scribusapi.h"
  21. #include "scrpalettebase.h"
  22. #include "scribusstructs.h"
  23.  
  24. class ScribusDoc;
  25. class ScComboBox;
  26.  
  27.  
  28. /*! \brief Preflight Verifier GUI (P.V.)
  29. A tool to check document for errors (in P.V. profiles)
  30. which can be set up in Preferences dialog.
  31. */
  32. class SCRIBUS_API CheckDocument : public ScrPaletteBase
  33. {
  34.     Q_OBJECT
  35.  
  36. public:
  37.     CheckDocument( QWidget* parent, bool modal );
  38.     ~CheckDocument() {};
  39.     
  40.     virtual void changeEvent(QEvent *e);
  41.  
  42.     /*! \brief State of the P.V. */
  43.     enum CheckMode { checkNULL, checkPDF, checkEPS, checkPrint, checkPrintPreview };
  44.  
  45.     /*! \brief Clean the list view tree and reset the P.V. attributes. */
  46.     void clearErrorList();
  47.     /*! \brief Get all possible errors for given document.
  48.     It walks through all errors filled in DocumentChecker::checkDocument()
  49.     to create a tree structure of error items:
  50.     - some item e.g. page
  51.     - - page item - its error if there is only one error
  52.     - - another item
  53.     - - - error 1
  54.     - - - warning X etc.
  55.     - another item...
  56.     \param doc a reference to the ScribusDoc */
  57.     void buildErrorList(ScribusDoc *doc);
  58.     /*! \brief Enable/disable "ignore" button and noButton property
  59.     \param state true to enable the button */
  60.     void setIgnoreEnabled(bool state);
  61.     /*! \brief Get the state of the "ignore" button
  62.     \retval true on button is visible */
  63.     bool isIgnoreEnabled();
  64.  
  65.     //! \brief Current state of P.V.
  66.     CheckMode checkMode;
  67.  
  68. public slots:
  69.     /*! \brief Called when is selected a new item in error list.
  70.     \param ite and item */
  71.     void slotSelect(QTreeWidgetItem* ite);
  72.     /*!\brief Do a manual rechecking. */
  73.     void doReScan();
  74.     /*! \brief Process error checking itself.
  75.     \param name a QString with P.V. profile name */
  76.     void newScan(const QString& name);
  77.  
  78. signals:
  79.     //void rescan();
  80.     //! \brief Signal emitted when user selects any page item in error list.
  81.     void selectElement(int, int);
  82.     //! \brief Signal emitted when user selects any page in error list.
  83.     void selectPage(int);
  84.     //! \brief Signal emitted when user selects any master page in error list.
  85.     void selectMasterPage(QString);
  86.     //! \brief Signal emitted when user selects any master page item in error list.
  87.     void selectMasterPageElement(QString, int);
  88.     //void selectNormal();
  89.     //! \brief Signal emitted when user press the "ignore errors" button.
  90.     void ignoreAllErrors();
  91.  
  92. protected:
  93.     QVBoxLayout* checkDocumentLayout;
  94.     QHBoxLayout* layout1;
  95.     QHBoxLayout* layout2;
  96.  
  97. protected slots:
  98.     virtual void languageChange();
  99.  
  100. private:
  101.     //! \brief Mappping Page Item - item nr.
  102.     QMap<QTreeWidgetItem*, int> itemMap;
  103.     //! \brief Mappping Page - page nr.
  104.     QMap<QTreeWidgetItem*, int> pageMap;
  105.     //! \brief Mappping Master Page - MP nr.
  106.     QMap<QTreeWidgetItem*, QString> masterPageMap;
  107.     //! \brief Mappping MP Item - MP item nr.
  108.     QMap<QTreeWidgetItem*, int> masterPageItemMap;
  109.  
  110.     //! \brief a reference to the current document
  111.     ScribusDoc* m_Doc;
  112.     //! \brief Icon for fatal error
  113.     QPixmap graveError;
  114.     //! \brief Icon for warning
  115.     QPixmap onlyWarning;
  116.     //! \brief Icon for OK
  117.     QPixmap noErrors;
  118.  
  119.     //! \brief Strings for common texts in GUI dialog tree
  120.     QString missingGlyph;
  121.     QString textOverflow;
  122.     QString notOnPage;
  123.     QString missingImg;
  124.     QString emptyImg;
  125.     QString lowDPI;
  126.     QString highDPI;
  127.     QString transpar;
  128.     QString annot;
  129.     QString rasterPDF;
  130.     QString isGIF;
  131.     QString isGIFtoolTip;
  132.     QString WrongFont;
  133.  
  134.     //! \brief Flag if is ignore button shown. true = hidden, false = shown.
  135.     bool noButton;
  136.     ScComboBox* curCheckProfile;
  137.     QLabel* textLabel1;
  138.     QTreeWidget* reportDisplay;
  139.     QPushButton* ignoreErrors;
  140.     QPushButton* reScan;
  141.  
  142. //     bool globalGraveError;
  143.     bool pageGraveError;
  144.     bool itemError;
  145.  
  146.     int minResDPI;
  147.     int maxResDPI;
  148.  
  149.     /*! \brief Create content of QTreeWidgetItem based on error type
  150.     and pageItem state.
  151.     \param item a reference to current QTreeWidgetItem to fill the data
  152.     \param errorType type of PreflightError value. There is one big switch/case.
  153.     \param pageItem data for item are taken here.
  154.     Available columns of item:
  155.         1) items' group or item name
  156.         2) detailed problem text
  157.         3) membersip in layer
  158.         4) beginning of the text (textframes) or image path (imageframe) (removed)
  159.     */
  160.     void buildItem(QTreeWidgetItem * item,
  161.                     PreflightError errorType,
  162.                     PageItem * pageItem);
  163. };
  164.  
  165. #endif // CHECKDOCUMENT_H
  166.